package ltd.sshine.networkserver.holder;

import io.netty.channel.Channel;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 服务器外部连接持有者
 */
public class ServerConnectHolder {
    private static final Map<String, Channel> connectHolder=new ConcurrentHashMap<>();

    public static void addChannel(String id,Channel channel){
        connectHolder.put(id,channel);
    }
    public static void removeChannel(String id){
        connectHolder.remove(id);
    }
    public static Channel getChannel(String id){
       return connectHolder.get(id);
    }
}
